package com.meta.platform.contract.intf.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;


/**
 * 发票收件人信息
 *
 * @author M.simple
 * @email 1111111111111@qq.com
 * @date 2020-12-08 15:53:38
 */
@Data
public class ContractInvoiceReceiver implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 自增主键
     */
    private Long id;

    /**
     * 发票id
     */
    @ApiModelProperty("发票id")
    private Long invoiceId;

    /**
     * 客户id
     */
    @ApiModelProperty("客户id")
    private Long customerId;

    /**
     * 收票人
     */
    @ApiModelProperty("收票人")
    @Size(max = 32)
    private String receiverName;

    /**
     * 收票人手机
     */
    @ApiModelProperty("收票人手机")
    @Size(max = 32)
    private String receiverMobile;

    /**
     * 收票人省份
     */
    @ApiModelProperty("收票人省份")
    private Long receiverProvince;

    /**
     * 收票人市区
     */
    @ApiModelProperty("收票人市区")
    private Long receiverCity;

    /**
     * 收票人区
     */
    @ApiModelProperty("收票人区")
    private Long receiverDistrict;

    /**
     * 详细地址
     */
    @ApiModelProperty("详细地址")
    @Size(max = 255)
    private String receiverDetailAddress;

    /**
     * 邮编
     */
    @ApiModelProperty("邮编")
    @Size(max = 255)
    private String receiverPostCode;

    /**
     * 电子邮箱
     */
    @ApiModelProperty("电子邮箱")
    @Size(max = 255)
    private String receiverEmail;

    /**
     * 租户ID
     */
    private Long tenantId;

    /**
     * 删除标志（0代表存在 1代表删除）
     */
    private Integer delFlag;

    /**
     * 创建者
     */
    private Long createBy;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新者
     */
    private Long updateBy;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 备注
     */
    private String remark;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ContractInvoiceReceiver)) return false;
        ContractInvoiceReceiver receiver = (ContractInvoiceReceiver) o;
        return Objects.equals(getReceiverName(), receiver.getReceiverName()) &&
                Objects.equals(getReceiverMobile(), receiver.getReceiverMobile()) &&
                Objects.equals(getReceiverProvince(), receiver.getReceiverProvince()) &&
                Objects.equals(getReceiverCity(), receiver.getReceiverCity()) &&
                Objects.equals(getReceiverDistrict(), receiver.getReceiverDistrict()) &&
                Objects.equals(getReceiverDetailAddress(), receiver.getReceiverDetailAddress()) &&
                Objects.equals(getReceiverPostCode(), receiver.getReceiverPostCode()) &&
                Objects.equals(getReceiverEmail(), receiver.getReceiverEmail());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getReceiverName(), getReceiverMobile(), getReceiverProvince(), getReceiverCity(), getReceiverDistrict(), getReceiverDetailAddress(), getReceiverPostCode(), getReceiverEmail());
    }
}
